from openpyxl import load_workbook

class excel():
    def __init__(self,path,sheetname):
        self.path = load_workbook(path)
        self.sheetname = self.path[sheetname]

    def get_data(self):
        datalist=[]
        for line in self.sheetname:
            lis = []
            lis.append(line[0].value)
            lis.append(line[1].value)
            lis.append(line[2].value)
            lis.append(line[3].value)
            datalist.append(lis)
        datalist.pop(0)
        return datalist

if __name__ == '__main__':
    path = 'D:\shixun1\pythonXM\longguoWebUI\longguoWebUI\data\data.xlsx'
    sheetname = 'Sheet1'
    db = excel(path,sheetname)
    print(db.get_data())
